package com.westcom.healthmate.common.network.http;

import java.io.IOException;

import com.westcom.healthmate.common.utils.CommonUtils;
import org.apache.http.Header;
import org.apache.http.HttpResponse;
import org.apache.http.HttpStatus;
import org.apache.http.HttpVersion;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.params.BasicHttpParams;
import org.apache.http.params.CoreProtocolPNames;
import org.apache.http.params.HttpParams;
import org.apache.http.util.EntityUtils;

public class SyncGet 
{
	private DefaultHttpClient mHttpClient;
	public static SyncGet create() 
	{
        return new SyncGet();
    }
	public SyncGet()
	{
	    mHttpClient = new DefaultHttpClient();
	}
	public HttpResponse get(String url,Header[] h)throws ClientProtocolException, IOException
	{ 
		HttpGet httpget = new HttpGet(url);
		if(null != h)
		{
			httpget.setHeaders(h);
		}
        CommonUtils.disableSSLVerification(mHttpClient);
		HttpResponse response=mHttpClient.execute(httpget); 
        return response;
	}
}
